package cn.zhf.shop.controller.client;

import cn.zhf.shop.entity.Message;
import cn.zhf.shop.entity.campus.CampusOverview;
import cn.zhf.shop.entity.lesson.Lesson;
import cn.zhf.shop.entity.lesson.LessonType;
import cn.zhf.shop.entity.organization.OrgCampus;
import cn.zhf.shop.entity.organization.OrganizationOverview;
import cn.zhf.shop.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/client/orgc")
@Api(tags = "客户端用 机构校区模块")
public class OrgCampusController {
    @Resource
    private OrgCampusService orgCampusService;

    @Resource
    private LessonTypeService typeService;

    @GetMapping("/recommend")
    @ApiOperation(value = "获取推荐列表")
    public Message<List<OrganizationOverview>> recommendCampus(String area, String provice, String city, String district){
        return orgCampusService.getRecommend(area,provice,city,district);
    }

    @GetMapping("/types")
    @ApiOperation(value = "中部导航")
    public Message<List<LessonType>> midNavs(){
        return typeService.H5getAll();
    }

    @GetMapping("/bottom")
    @ApiOperation(value = "获取课程类型获得机构数据")
    public Message<List<OrganizationOverview>> bottomRecommendCampus(String type){
        return orgCampusService.getByLessonType(type);
    }
    @GetMapping("/org")
    @ApiOperation(value = "获取机构id获得机构数据")
    public Message<List<OrganizationOverview>> getByOrg(int orgId){
        return orgCampusService.getByOrgId(orgId);
    }

    @GetMapping("/campus")
    @ApiOperation(value = "获取校区id获得机构数据")
    public Message<CampusOverview>getByCampus(int campusId){
        return orgCampusService.getByCampusId(campusId);
    }





}
